package com.wangbo.springmvc001.myjunit;

import java.util.List;

import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;

import com.wangbo.springmvc001.daoimpl.NameDaoImpl;
import com.wangbo.springmvc001.entity.Name;

public class MyDaoTest {
	private static SessionFactory sessionFactory;
	@BeforeClass
	public static void beforeClass() {
			sessionFactory = new AnnotationConfiguration().configure().buildSessionFactory();
	}
   
	@AfterClass
	public static void afterClass() {
		sessionFactory.close();
	}
	
	@Test
	public void myDaoTest(){
		NameDaoImpl ndi = new NameDaoImpl();
		List<Name> ln  = ndi.getList();
		System.out.println(ln);
	}

}
